package protoType;

import java.io.IOException;

public class Client {

    public static void main(String[] args) throws IOException {
        Sheep sheep = new Sheep("多莉",11,"蒙古");
        sheep.friend = new Sheep("玛丽",12,"蒙古");
        /*Sheep clone1 = sheep.clone();
        Sheep clone2 = sheep.clone();*/
        Sheep clone1 = sheep.deepClone();
        Sheep clone2 = sheep.deepClone();
        System.out.println("原型为：" + sheep  + " " + sheep.friend.hashCode());
        System.out.println("克隆1为：" + clone1 + " " + clone1.friend.hashCode());
        System.out.println("克隆2为：" + clone2 + " " + clone2.friend.hashCode());


    }


}
